package one.stand.mapper;

import one.stand.model.essay.TaskStaffModel;
import one.stand.request.essay.MyTaskDetailQuery;
import one.stand.request.essay.MyTaskQuery;
import one.stand.request.essay.TaskStaffRequest;
import one.stand.request.essay.UpdateMyTaskFrom;
import one.stand.response.essay.MyTaskResponse;
import one.stand.response.essay.MyTaskUserResponse;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 任务员工 Mapper 接口
 * </p>
 *
 * @author luoyang
 * @since 2020-05-11
 */
public interface TaskStaffMapper {

    TaskStaffModel queryById(int id);

    int deleteById(int id);

    int update(TaskStaffModel taskStaffModel);

    int insert(List<TaskStaffModel> models);

    List<TaskStaffModel> queryAll(TaskStaffRequest taskStaffRequest);

    int deleteByTaskId(Long id);

    List<Integer> queryTaskUser(Long id);

    int updateMyTaskViewState(UpdateMyTaskFrom request);

    int updateMyTaskState(UpdateMyTaskFrom request);

    /**
     * 查询我的任务
     * @param request
     * @return
     */
    List<MyTaskResponse> queryMyTask(MyTaskQuery request);

    /**
     * 我发布的
     * @param request
     * @return
     */
    List<MyTaskResponse> queryMyPubTask(MyTaskQuery request);


    MyTaskResponse queryMyTaskDetail(MyTaskDetailQuery request);

    MyTaskResponse queryMyPubTaskDetail(MyTaskDetailQuery request);

    List<MyTaskUserResponse> queryMyTaskUser(MyTaskDetailQuery request);

    List<TaskStaffModel> queryAllTask(@Param("endTime") Date endTime);

    /**
     * 按员工 文章id查询员工任务
     * @param myTaskDetailQuery
     * @return
     */
    TaskStaffModel queryMyTaskStaffDetail(MyTaskDetailQuery myTaskDetailQuery);
}
